<template>
	<view class="volunteer">
		<swiper :circular="true" :autoplay="true" interval="2000" indicator-dots>
			<swiper-item v-for="item in lun" :key="item.id">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 100%;"></image>
			</swiper-item>
		</swiper>
		<view class="v1">
			<view class="v2" v-for="item in news" :key="item.id">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 100%;"></image>
				<view class="v3">
					<text>{{item.title}}</text>
				</view>
				<view class="v3">
					<text>{{item.summary}}</text>
				</view>
				<text>发布时间：{{item.createTime}}</text>
			</view>
		</view>
		<u-tabbar>
			<u-tabbar-item text="志愿活动" icon="file-text" @click="toavtive"></u-tabbar-item>
			<u-tabbar-item text="我的活动" icon="account" @click="tomy"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lun:[],
				news:[]
			}
		},
		onLoad() {
			this.getlunbo()
			this.getnews()
		},
		methods: {
			getlunbo(){
				this.api.get('/prod-api/api/volunteer-service/ad-banner/list').then(res=>{
					this.lun=res.data.data
				})
			},
			getnews(){
				this.api.get('/prod-api/api/volunteer-service/news/list').then(res=>{
					this.news=res.data.rows
				})
			},
			toavtive(){
				uni.navigateTo({
					url:'/pages/serve/volunteer/ative/ative'
				})
			},
			tomy(){
				uni.navigateTo({
					url:'/pages/serve/volunteer/myvolunteer/myvolunteer'
				})
			}
		}
	}
</script>

<style lang="scss">
.v1{
	margin-top: 15px;
	.v2{
		line-height: 30px;
		font-size: 16px;
		margin-top: 10px;
		.v3{
			
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}
}

</style>
